<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组 </title>
</head>
<body>
<h2>数组是对象</h2>
<p>在 JavaScript 中对数组使用 typeof 运算符会返回 "object"。</p>

<p id="demo"></p>

<script>
  var person = ["Bill", "Gates", 62];  //使用数字来访问其“元素”
  var person1 = {firstName:"Bill", lastName:"Gates", age:19};   //对象使用名称来访问其“成员”
  document.getElementById("demo").innerHTML = person[0]+"<br>"+person1["firstName"];
</script>
</body>
</html>

<!--
Bill
Bill
-->